package GameMain.View.WaitGame
{
	import flash.display.MovieClip;
	import flash.display.Sprite;

	public class TeamItem
	{
		private var _mc:Sprite = null;
		
		public function TeamItem(mc:MovieClip)
		{
			this._mc = mc;
			this.setTeamState(false);
			this._mc.mouseChildren = false;
			this._mc.mouseEnabled = false;
		}
		
		public function setTeamState(state:Boolean):void
		{
			if(state)
			{
				this._mc["PER_TXT"].visible = true;
				this._mc["P_NAME_TEXT"].visible = true;
				this._mc["OK_BT"].visible = false;
			}
			else
			{
				this._mc["PER_TXT"].visible = false;
				this._mc["OK_BT"].visible = false;
				this._mc["P_NAME_TEXT"].visible = false;
				this._mc["P_NAME_TEXT"].text = "";
				this._mc["PER_TXT"].text = "";
			}
		}
		
		public function setPlayerName(_name:String):void
		{
			this._mc["P_NAME_TEXT"].text = _name;
		}
		
		public function setPercent(per:int):void
		{
			if(per < 100)
			{
				this._mc["PER_TXT"].text = String(per) + "%";
			}
			else
			{
				this._mc["PER_TXT"].visible = false;
				this._mc["OK_BT"].visible = true;
			}
		}
	}
}